package com.bzyd.derby.mapper;

import com.bzyd.derby.entity.User;
import com.bzyd.derby.plugin.Page;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author Xianyue Dang
 * @since 2021-08-24
 */
@Repository
public interface UserMapper {

    int checkUserExist();

    int createUserTable();

    User findById(@Param("id") Integer id);

    List<User> findUserList(@Param("name") String name, @Param("age") Integer age);

    int saveUser(User user);

    int updateById(User user);

    int deleteById(@Param("id") Integer id);

    int count(@Param("name") String name);

    List<User> findByPage(@Param("name") String name, @Param("startIndex") int startIndex, @Param("pageSize") int pageSize);

    List<User> findByPage2(Page page, @Param("name") String name);

    List<User> selectAllUser();
}
